import 'package:flutter_novel/generated/json/base/json_convert_content.dart';
import 'package:flutter_novel/detail/data/model/commit_model_entity.dart';

CommitModelEntity $CommitModelEntityFromJson(Map<String, dynamic> json) {
	final CommitModelEntity commitModelEntity = CommitModelEntity();
	final int? totalReviews = jsonConvert.convert<int>(json['total_reviews']);
	if (totalReviews != null) {
		commitModelEntity.totalReviews = totalReviews;
	}
	final List<CommitModelReviews>? reviews = jsonConvert.convertListNotNull<CommitModelReviews>(json['reviews']);
	if (reviews != null) {
		commitModelEntity.reviews = reviews;
	}
	final int? comicReviewsCnt = jsonConvert.convert<int>(json['comic_reviews_cnt']);
	if (comicReviewsCnt != null) {
		commitModelEntity.comicReviewsCnt = comicReviewsCnt;
	}
	return commitModelEntity;
}

Map<String, dynamic> $CommitModelEntityToJson(CommitModelEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['total_reviews'] = entity.totalReviews;
	data['reviews'] =  entity.reviews?.map((v) => v.toJson()).toList();
	data['comic_reviews_cnt'] = entity.comicReviewsCnt;
	return data;
}

CommitModelReviews $CommitModelReviewsFromJson(Map<String, dynamic> json) {
	final CommitModelReviews commitModelReviews = CommitModelReviews();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		commitModelReviews.id = id;
	}
	final String? uid = jsonConvert.convert<String>(json['uid']);
	if (uid != null) {
		commitModelReviews.uid = uid;
	}
	final String? nickName = jsonConvert.convert<String>(json['nick_name']);
	if (nickName != null) {
		commitModelReviews.nickName = nickName;
	}
	final String? face = jsonConvert.convert<String>(json['face']);
	if (face != null) {
		commitModelReviews.face = face;
	}
	final int? comicId = jsonConvert.convert<int>(json['comic_id']);
	if (comicId != null) {
		commitModelReviews.comicId = comicId;
	}
	final String? title = jsonConvert.convert<String>(json['title']);
	if (title != null) {
		commitModelReviews.title = title;
	}
	final String? verticalCover = jsonConvert.convert<String>(json['vertical_cover']);
	if (verticalCover != null) {
		commitModelReviews.verticalCover = verticalCover;
	}
	final int? type = jsonConvert.convert<int>(json['type']);
	if (type != null) {
		commitModelReviews.type = type;
	}
	final String? reviewTitle = jsonConvert.convert<String>(json['review_title']);
	if (reviewTitle != null) {
		commitModelReviews.reviewTitle = reviewTitle;
	}
	final String? content = jsonConvert.convert<String>(json['content']);
	if (content != null) {
		commitModelReviews.content = content;
	}
	final int? verify = jsonConvert.convert<int>(json['verify']);
	if (verify != null) {
		commitModelReviews.verify = verify;
	}
	final int? score = jsonConvert.convert<int>(json['score']);
	if (score != null) {
		commitModelReviews.score = score;
	}
	final CommitModelReviewsDetail? detail = jsonConvert.convert<CommitModelReviewsDetail>(json['detail']);
	if (detail != null) {
		commitModelReviews.detail = detail;
	}
	final String? currentTime = jsonConvert.convert<String>(json['current_time']);
	if (currentTime != null) {
		commitModelReviews.currentTime = currentTime;
	}
	final String? scoreUpdateTime = jsonConvert.convert<String>(json['score_update_time']);
	if (scoreUpdateTime != null) {
		commitModelReviews.scoreUpdateTime = scoreUpdateTime;
	}
	final int? day = jsonConvert.convert<int>(json['day']);
	if (day != null) {
		commitModelReviews.day = day;
	}
	final String? ctime = jsonConvert.convert<String>(json['ctime']);
	if (ctime != null) {
		commitModelReviews.ctime = ctime;
	}
	final String? mtime = jsonConvert.convert<String>(json['mtime']);
	if (mtime != null) {
		commitModelReviews.mtime = mtime;
	}
	final List<dynamic>? authors = jsonConvert.convertListNotNull<dynamic>(json['authors']);
	if (authors != null) {
		commitModelReviews.authors = authors;
	}
	final List<dynamic>? styles = jsonConvert.convertListNotNull<dynamic>(json['styles']);
	if (styles != null) {
		commitModelReviews.styles = styles;
	}
	final String? rejectReason = jsonConvert.convert<String>(json['reject_reason']);
	if (rejectReason != null) {
		commitModelReviews.rejectReason = rejectReason;
	}
	final int? likeCount = jsonConvert.convert<int>(json['like_count']);
	if (likeCount != null) {
		commitModelReviews.likeCount = likeCount;
	}
	final int? likeAction = jsonConvert.convert<int>(json['like_action']);
	if (likeAction != null) {
		commitModelReviews.likeAction = likeAction;
	}
	final int? commentCount = jsonConvert.convert<int>(json['comment_count']);
	if (commentCount != null) {
		commitModelReviews.commentCount = commentCount;
	}
	final List<dynamic>? users = jsonConvert.convertListNotNull<dynamic>(json['users']);
	if (users != null) {
		commitModelReviews.users = users;
	}
	final int? spoiler = jsonConvert.convert<int>(json['spoiler']);
	if (spoiler != null) {
		commitModelReviews.spoiler = spoiler;
	}
	final bool? isHot = jsonConvert.convert<bool>(json['is_hot']);
	if (isHot != null) {
		commitModelReviews.isHot = isHot;
	}
	final int? comicScore = jsonConvert.convert<int>(json['comic_score']);
	if (comicScore != null) {
		commitModelReviews.comicScore = comicScore;
	}
	final String? umtime = jsonConvert.convert<String>(json['umtime']);
	if (umtime != null) {
		commitModelReviews.umtime = umtime;
	}
	final int? level = jsonConvert.convert<int>(json['level']);
	if (level != null) {
		commitModelReviews.level = level;
	}
	final CommitModelReviewsReadDepthInfo? readDepthInfo = jsonConvert.convert<CommitModelReviewsReadDepthInfo>(json['read_depth_info']);
	if (readDepthInfo != null) {
		commitModelReviews.readDepthInfo = readDepthInfo;
	}
	return commitModelReviews;
}

Map<String, dynamic> $CommitModelReviewsToJson(CommitModelReviews entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['uid'] = entity.uid;
	data['nick_name'] = entity.nickName;
	data['face'] = entity.face;
	data['comic_id'] = entity.comicId;
	data['title'] = entity.title;
	data['vertical_cover'] = entity.verticalCover;
	data['type'] = entity.type;
	data['review_title'] = entity.reviewTitle;
	data['content'] = entity.content;
	data['verify'] = entity.verify;
	data['score'] = entity.score;
	data['detail'] = entity.detail?.toJson();
	data['current_time'] = entity.currentTime;
	data['score_update_time'] = entity.scoreUpdateTime;
	data['day'] = entity.day;
	data['ctime'] = entity.ctime;
	data['mtime'] = entity.mtime;
	data['authors'] =  entity.authors;
	data['styles'] =  entity.styles;
	data['reject_reason'] = entity.rejectReason;
	data['like_count'] = entity.likeCount;
	data['like_action'] = entity.likeAction;
	data['comment_count'] = entity.commentCount;
	data['users'] =  entity.users;
	data['spoiler'] = entity.spoiler;
	data['is_hot'] = entity.isHot;
	data['comic_score'] = entity.comicScore;
	data['umtime'] = entity.umtime;
	data['level'] = entity.level;
	data['read_depth_info'] = entity.readDepthInfo?.toJson();
	return data;
}

CommitModelReviewsDetail $CommitModelReviewsDetailFromJson(Map<String, dynamic> json) {
	final CommitModelReviewsDetail commitModelReviewsDetail = CommitModelReviewsDetail();
	final int? plot = jsonConvert.convert<int>(json['plot']);
	if (plot != null) {
		commitModelReviewsDetail.plot = plot;
	}
	final int? picture = jsonConvert.convert<int>(json['picture']);
	if (picture != null) {
		commitModelReviewsDetail.picture = picture;
	}
	final int? character = jsonConvert.convert<int>(json['character']);
	if (character != null) {
		commitModelReviewsDetail.character = character;
	}
	return commitModelReviewsDetail;
}

Map<String, dynamic> $CommitModelReviewsDetailToJson(CommitModelReviewsDetail entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['plot'] = entity.plot;
	data['picture'] = entity.picture;
	data['character'] = entity.character;
	return data;
}

CommitModelReviewsReadDepthInfo $CommitModelReviewsReadDepthInfoFromJson(Map<String, dynamic> json) {
	final CommitModelReviewsReadDepthInfo commitModelReviewsReadDepthInfo = CommitModelReviewsReadDepthInfo();
	final int? comicId = jsonConvert.convert<int>(json['comic_id']);
	if (comicId != null) {
		commitModelReviewsReadDepthInfo.comicId = comicId;
	}
	final int? isFinished = jsonConvert.convert<int>(json['is_finished']);
	if (isFinished != null) {
		commitModelReviewsReadDepthInfo.isFinished = isFinished;
	}
	final int? onlineTextEpCnt = jsonConvert.convert<int>(json['online_text_ep_cnt']);
	if (onlineTextEpCnt != null) {
		commitModelReviewsReadDepthInfo.onlineTextEpCnt = onlineTextEpCnt;
	}
	final int? publishReadOnlineTextCnt = jsonConvert.convert<int>(json['publish_read_online_text_cnt']);
	if (publishReadOnlineTextCnt != null) {
		commitModelReviewsReadDepthInfo.publishReadOnlineTextCnt = publishReadOnlineTextCnt;
	}
	return commitModelReviewsReadDepthInfo;
}

Map<String, dynamic> $CommitModelReviewsReadDepthInfoToJson(CommitModelReviewsReadDepthInfo entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['comic_id'] = entity.comicId;
	data['is_finished'] = entity.isFinished;
	data['online_text_ep_cnt'] = entity.onlineTextEpCnt;
	data['publish_read_online_text_cnt'] = entity.publishReadOnlineTextCnt;
	return data;
}